package com.example.prom.ok.y2023.work.webservice;

import com.alibaba.fastjson.JSON;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;

public class WebServiceHandler {
    public static void main(String[] args) {
        JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
        Client client = clientFactory.createClient("https://tckimlik.nvi.gov.tr/Service/KPSPublic.asmx?WSDL");
        Object[] result = new Object[0];
        try {
            result = client.invoke("TCKimlikNoDogrula", 18218333100L, "ESER", "Kaya", 1998);
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println(result[0]);
        System.out.println(JSON.toJSONString(result));
    }
}
